/**

*@Description: 对热门榜视频评论的爬取

*@Author: 董辰

*@Date: 2022/1/17

*/


// 改我代码写注释！！！！！！！！！

package com.controller;

import com.model.HotComment;
import com.model.HotCommentSex;
import com.model.HotList;
import com.server.HotCommentService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api("热门榜单评论")
@RestController
@RequestMapping(value = "/hotComment")
public class HotCommentController {
    @Autowired
    private HotCommentService hotCommentService;


    // 根据bv号，按评论获赞数，从高到底排列评论
    @CrossOrigin
    @RequestMapping(value = "/getHotComment", produces = "application/json;charset=utf-8", method = RequestMethod.GET)
    public List<HotComment> getHotComment(String bv){
        System.out.println("进入用户查询方法");
        return hotCommentService.getHotComment(bv);
    }


    // 根据bv号 获取男女比例，评论数，各个等级人数
    @CrossOrigin
    @RequestMapping(value = "/getCommentSex", produces = "application/json;charset=utf-8", method = RequestMethod.GET)
    public List<HotCommentSex> getCommentSex(String bv){
        System.out.println("进入性别比例查询方法");
        List<HotCommentSex> hotCommentSexes = hotCommentService.getCommentSex(bv);
        return hotCommentSexes;
    }

    @CrossOrigin
    @RequestMapping(value = "/getDetail", produces = "application/json;charset=utf-8", method = RequestMethod.GET)
    public List<HotList> getDetail(String bv){
        System.out.println("进入性别比例查询方法");
        List<HotList> hotList = hotCommentService.getDetail(bv);
        return hotList;
    }

}
